/*
 * Copyright 2006-2007 Queplix Corp.
 *
 * Licensed under the Modified Queplix BSD License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.queplix.com/BSDLICENSE-1.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.jlect.swebing.renderers.client;

/**
 * Renderer delegate class
 *
 * @author Sergey Kozmin
 * @since Nov 23, 2007
 */
public class RendererDelegate implements Renderer {
    private Renderer renderer;

    public RendererDelegate(Renderer renderer) {
        if(renderer == null) {
            throw new IllegalArgumentException("Could not work with null object renderer. ");
        }
        this.renderer = renderer;
    }

    public Renderer getRenderer() {
        return renderer;
    }

    public int getWidth() {
        return renderer.getWidth();
    }

    public int getHeight() {
        return renderer.getHeight();
    }

    public int getX() {
        return renderer.getX();
    }

    public int getY() {
        return renderer.getY();
    }

    public void setLocation(int x, int y) {
        renderer.setLocation(x, y);
    }

    public void setSize(int width, int height) {
        renderer.setSize(width, height);
    }

    public void setBounds(int x, int y, int width, int height) {
        renderer.setBounds(x, y, width, height);
    }

    public void setEnabled(boolean enabled) {
        renderer.setEnabled(enabled);
    }

    public boolean isEligibile() {
        return renderer.isEligibile();
    }

    public void setEligibilityListener(EligibilityListener listener) {
        renderer.setEligibilityListener(listener);
    }

    public void setMouseListener(EligibilityListener listener) {
        renderer.setMouseListener(listener);
    }
}
